// 用户相关接口
var express = require('express');
const productController = require('../../controllers/admin/productControllers');
var productRouter = express.Router();

const multer  = require('multer')
const upload = multer({ dest: 'public/productUploads/' })


// 添加产品接口,涉及文件上传
productRouter.post('/product/add', upload.single('file'),productController.add) 
// 获取产品列表接口
productRouter.get('/product/list',productController.list) 
// 删除产品接口
productRouter.delete('/product/delete',productController.delete)
// 获取产品详情接口
productRouter.get('/product/detail',productController.detail)
// 更新产品接口
productRouter.put('/product/update', upload.single('file'),productController.update)



module.exports = productRouter;